package cn.livingCloud.dto;

import cn.livingCloud.entity.content.ArticleReply;
import cn.livingCloud.entity.content.ImageTextReply;
import cn.livingCloud.entity.content.ReplyRule;
import cn.livingCloud.wechat.protocol.resp.Article;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by 唐旭 on 2015/12/26.
 */
public class ArticlesReplyRuleDto extends ReplyRuleDto {
    private List<ArticleReplyDto> articleList = new ArrayList<>();

    public ArticlesReplyRuleDto(ReplyRule replyRule) {
        super(replyRule);
        ImageTextReply content = (ImageTextReply) replyRule.getContent();
        for (Article article : content.getArticles()) {
            ArticleReply articleReply = (ArticleReply) article;
            articleList.add(new ArticleReplyDto(articleReply));
        }
    }

    public List<ArticleReplyDto> getArticleList() {
        return articleList;
    }

    public ArticlesReplyRuleDto setArticleList(List<ArticleReplyDto> articleList) {
        this.articleList = articleList;
        return this;
    }
}
